package cn.echo.modules.sys.controller;

import cn.echo.modules.sys.entity.Admin;
import cn.echo.modules.sys.service.AdminService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by LSF_ on 2017/5/7.
 */
@WebServlet("/admin")
public class AdminServlet extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        AdminService adminService=new AdminService();

//        List<Admin> list=adminService.findAll();
//        System.out.println(list);
         Admin admin=new Admin();
        admin.setUsername("username_");
        String  id=adminService.findIdByUsername(admin);

        PrintWriter printWriter=resp.getWriter();
//        printWriter.print(list);
        printWriter.print(id);
        printWriter.flush();
        printWriter.close();

    }
}
